package com.xc.c1

object enum01 {
  def main(args: Array[String]): Unit = {
    println(type01)

    println("is online = " + type01.ifOnline(type01.offline))
  }
}

object type01 extends Enumeration {
  type type01 = Value
  val onLine = Value("online")
  val offline = Value("offline")

  override def toString(): String = {
    type01.values.mkString(",")
  }

  def ifOnline(intype: type01) = {
    intype == onLine
  }
}
